package Studing;

import java.util.ArrayList;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * @ClassName TestZFC
 * @Description: TODO
 * @Author hl
 * @Date 2020/9/20
 * @Version V1.0
 **/
public class TestZFC {
    public static void main(String[] args) {
        String res="AcBadeD";
        System.out.println(seach(res));
    }
    public static String seach(String str){
       char []arr1=new  char[26];
       char []arr2=new char[26];
       for(int i=0;i<str.length();i++){
           char key=str.charAt(i);
           if(Character.isUpperCase(key)){
               arr1[key-'A']=key;
           }else{
               arr2[key-'a']=key;
           }
       }
       String res="";

       for(int i=0;i<arr1.length;i++){
           if(arr1[i]!=0){
               res+=arr1[i];
           }
           if(arr2[i]!=0){
               res+=arr2[i];
           }
       }
       return res;

    }

}
